home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / VB Transla26119982001.psc / frmMain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-09-08  |  8.6 KB  |  287 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "VB Translator Lite"
  5.    ClientHeight    =   3255
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   5760
  9.    BeginProperty Font 
  10.       Name            =   "Tahoma"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    Icon            =   "frmMain.frx":0000
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    ScaleHeight     =   3255
  23.    ScaleWidth      =   5760
  24.    StartUpPosition =   2  'CenterScreen
  25.    Begin VB.CommandButton Command1 
  26.       Caption         =   "Help"
  27.       Height          =   375
  28.       Left            =   3720
  29.       TabIndex        =   4
  30.       Top             =   2640
  31.       Width           =   855
  32.    End
  33.    Begin VB.CommandButton cmdExit 
  34.       Caption         =   "Exit"
  35.       Height          =   375
  36.       Left            =   4680
  37.       TabIndex        =   5
  38.       Top             =   2640
  39.       Width           =   855
  40.    End
  41.    Begin VB.CommandButton cmdAbout 
  42.       Caption         =   "About"
  43.       Height          =   375
  44.       Left            =   2760
  45.       TabIndex        =   3
  46.       Top             =   2640
  47.       Width           =   855
  48.    End
  49.    Begin VB.OptionButton optEng 
  50.       Caption         =   "English/Portuguese"
  51.       Height          =   255
  52.       Left            =   3600
  53.       TabIndex        =   7
  54.       Top             =   1200
  55.       Width           =   1695
  56.    End
  57.    Begin VB.OptionButton optPort 
  58.       Caption         =   "Portuguese/English"
  59.       Height          =   255
  60.       Left            =   1800
  61.       TabIndex        =   6
  62.       Top             =   1200
  63.       Value           =   -1  'True
  64.       Width           =   1695
  65.    End
  66.    Begin VB.TextBox Text2 
  67.       Height          =   285
  68.       Left            =   1800
  69.       Locked          =   -1  'True
  70.       MaxLength       =   50
  71.       TabIndex        =   1
  72.       Top             =   2115
  73.       Width           =   3735
  74.    End
  75.    Begin VB.CommandButton cmdTranslate 
  76.       Caption         =   "Translate"
  77.       Default         =   -1  'True
  78.       Height          =   375
  79.       Left            =   1800
  80.       TabIndex        =   2
  81.       Top             =   2640
  82.       Width           =   855
  83.    End
  84.    Begin VB.TextBox Text1 
  85.       Height          =   285
  86.       Left            =   1800
  87.       MaxLength       =   50
  88.       TabIndex        =   0
  89.       Top             =   1665
  90.       Width           =   3735
  91.    End
  92.    Begin VB.Image Image1 
  93.       Height          =   480
  94.       Left            =   480
  95.       Picture         =   "frmMain.frx":058A
  96.       Stretch         =   -1  'True
  97.       Top             =   240
  98.       Width           =   480
  99.    End
  100.    Begin VB.Image Image3 
  101.       Height          =   480
  102.       Left            =   840
  103.       Picture         =   "frmMain.frx":0B14
  104.       Top             =   360
  105.       Width           =   480
  106.    End
  107.    Begin VB.Image Image2 
  108.       Height          =   480
  109.       Left            =   120
  110.       Picture         =   "frmMain.frx":0F56
  111.       Top             =   360
  112.       Width           =   480
  113.    End
  114.    Begin VB.Label Label6 
  115.       AutoSize        =   -1  'True
  116.       BackStyle       =   0  'Transparent
  117.       Caption         =   "By Frederico Machado"
  118.       BeginProperty Font 
  119.          Name            =   "Tahoma"
  120.          Size            =   9
  121.          Charset         =   0
  122.          Weight          =   700
  123.          Underline       =   0   'False
  124.          Italic          =   0   'False
  125.          Strikethrough   =   0   'False
  126.       EndProperty
  127.       Height          =   210
  128.       Left            =   2280
  129.       TabIndex        =   13
  130.       Top             =   720
  131.       Width           =   1995
  132.    End
  133.    Begin VB.Label Label5 
  134.       AutoSize        =   -1  'True
  135.       BackStyle       =   0  'Transparent
  136.       Caption         =   "Lite"
  137.       BeginProperty Font 
  138.          Name            =   "Tahoma"
  139.          Size            =   15.75
  140.          Charset         =   0
  141.          Weight          =   400
  142.          Underline       =   0   'False
  143.          Italic          =   0   'False
  144.          Strikethrough   =   0   'False
  145.       EndProperty
  146.       ForeColor       =   &H00000000&
  147.       Height          =   375
  148.       Left            =   4680
  149.       TabIndex        =   12
  150.       Top             =   480
  151.       Width           =   495
  152.    End
  153.    Begin VB.Label Label4 
  154.       AutoSize        =   -1  'True
  155.       BackStyle       =   0  'Transparent
  156.       Caption         =   "Translator"
  157.       BeginProperty Font 
  158.          Name            =   "Tahoma"
  159.          Size            =   24
  160.          Charset         =   0
  161.          Weight          =   400
  162.          Underline       =   0   'False
  163.          Italic          =   0   'False
  164.          Strikethrough   =   0   'False
  165.       EndProperty
  166.       ForeColor       =   &H00808000&
  167.       Height          =   585
  168.       Left            =   2880
  169.       TabIndex        =   11
  170.       Top             =   120
  171.       Width           =   2160
  172.    End
  173.    Begin VB.Label Label3 
  174.       BackStyle       =   0  'Transparent
  175.       Caption         =   "VB"
  176.       BeginProperty Font 
  177.          Name            =   "Tahoma"
  178.          Size            =   24
  179.          Charset         =   0
  180.          Weight          =   400
  181.          Underline       =   0   'False
  182.          Italic          =   0   'False
  183.          Strikethrough   =   0   'False
  184.       EndProperty
  185.       ForeColor       =   &H00000000&
  186.       Height          =   495
  187.       Left            =   2160
  188.       TabIndex        =   10
  189.       Top             =   120
  190.       Width           =   615
  191.    End
  192.    Begin VB.Label Label2 
  193.       AutoSize        =   -1  'True
  194.       BackStyle       =   0  'Transparent
  195.       Caption         =   "Translated Text:"
  196.       BeginProperty Font 
  197.          Name            =   "Tahoma"
  198.          Size            =   8.25
  199.          Charset         =   0
  200.          Weight          =   700
  201.          Underline       =   0   'False
  202.          Italic          =   0   'False
  203.          Strikethrough   =   0   'False
  204.       EndProperty
  205.       Height          =   195
  206.       Left            =   105
  207.       TabIndex        =   9
  208.       Top             =   2160
  209.       Width           =   1395
  210.    End
  211.    Begin VB.Label Label1 
  212.       AutoSize        =   -1  'True
  213.       BackStyle       =   0  'Transparent
  214.       Caption         =   "Original Text:"
  215.       BeginProperty Font 
  216.          Name            =   "Tahoma"
  217.          Size            =   8.25
  218.          Charset         =   0
  219.          Weight          =   700
  220.          Underline       =   0   'False
  221.          Italic          =   0   'False
  222.          Strikethrough   =   0   'False
  223.       EndProperty
  224.       Height          =   195
  225.       Left            =   360
  226.       TabIndex        =   8
  227.       Top             =   1680
  228.       Width           =   1125
  229.    End
  230.    Begin VB.Shape Shape1 
  231.       FillColor       =   &H00FFFFFF&
  232.       FillStyle       =   0  'Solid
  233.       Height          =   3735
  234.       Left            =   -120
  235.       Top             =   -120
  236.       Width           =   1695
  237.    End
  238. Attribute VB_Name = "frmMain"
  239. Attribute VB_GlobalNameSpace = False
  240. Attribute VB_Creatable = False
  241. Attribute VB_PredeclaredId = True
  242. Attribute VB_Exposed = False
  243. Dim dbase As Database
  244. Dim dictionary As Recordset
  245. Private Sub cmdAbout_Click()
  246.   frmAbout.Show 1
  247. End Sub
  248. Private Sub cmdExit_Click()
  249.   Unload Me
  250. End Sub
  251. Private Sub cmdTranslate_Click()
  252.   If Text1 = "" Then Exit Sub
  253.   If optPort.Value = True Then
  254.     dictionary.FindFirst "portuguese='" & Text1 & "'"
  255.     If dictionary.NoMatch Then
  256.       Text2 = Text1
  257.     Else
  258.       Text2 = dictionary!english
  259.     End If
  260.   ElseIf optEng.Value = True Then
  261.     dictionary.FindFirst "english='" & Text1 & "'"
  262.     If dictionary.NoMatch Then
  263.       Text2 = Text1
  264.     Else
  265.       Text2 = dictionary!portuguese
  266.     End If
  267.   End If
  268. End Sub
  269. Private Sub Command1_Click()
  270.   frmHelp.Show 1
  271. End Sub
  272. Private Sub Form_Load()
  273.   mypath = App.Path
  274.   If Right$(mypath, 1) <> "\" Then mypath = mypath & "\"
  275.   Set dbase = OpenDatabase(mypath & "data.mdb")
  276.   Set dictionary = dbase.OpenRecordset("select * from dictionary")
  277. End Sub
  278. Private Sub optEng_Click()
  279.   Text1.SetFocus
  280. End Sub
  281. Private Sub optPort_Click()
  282.   Text1.SetFocus
  283. End Sub
  284. Private Sub Text1_KeyPress(KeyAscii As Integer)
  285.   If KeyAscii = 32 Then KeyAscii = 0
  286. End Sub
  287.